﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using JM.JCY.Common;
using JM.JCY.DataAccess;
using JM.JCY.BusinessEntity;

namespace JM.JCY.BusinessComponent
{
    public class EventBC : JCYBusinessComponentBase<EventDA>
    {
        public EventBC()
            : base(new EventDA())
        {
        }

        public void UpdateEvent(EventDataset.T_EventDataTable dt)
        {
            this.DataAccess.UpdateEvent(dt);
        }

        public void UpdateEventReceiver(EventDataset.T_Event_ReceiverDataTable dt)
        {
            this.DataAccess.UpdateEventReceiver(dt);
        }

        public EventDataset.T_Event_S_ByReceiverDataTable GetEventByReceiver(string subject, int receiverId, DateTime? startDate, DateTime? endDate, string status)
        {
            return this.DataAccess.GetEventByReceiver(subject, receiverId, startDate, endDate, status);
        }

        public EventDataset.T_Event_S_BySenderDataTable GetEventBySender(string subject, int senderId, DateTime? startDate, DateTime? endDate, string status)
        {
            return this.DataAccess.GetEventBySender(subject, senderId, startDate, endDate, status);
        }

        public EventDataset.T_EventDataTable GetEventDetailById(int eventId)
        {
            return this.DataAccess.GetEventDetailById(eventId);
        }

        public EventDataset.T_Event_ReceiverDataTable GetEventReceiverById(int eventId)
        {
            return this.DataAccess.GetEventReceiverById(eventId);
        }

        public EventDataset.T_Event_ReceiverDataTable GetEventReceiverByReceiverId(int receiverId)
        {
            return this.DataAccess.GetEventReceiverByReceiverId(receiverId);
        }

        public EventDataset.T_EventDataTable GetEventForHome(int count, int receiverId)
        {
            return this.DataAccess.GetEventForHome(count, receiverId);
        }


        public EventDataset.T_EventDataTable GetMyEvent(string userName, string status, string type)
        {
            return this.DataAccess.GetMyEvent(userName,status,type);
        }
    }
}
